#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int i = 0;
    char arr[1000] = { 0 };
    int sum = 0;
    scanf("%s", arr);
    while (arr[i])
    {
        if (arr[i] == 'A')
            sum++;
        else if (arr[i] == 'B')
            sum--;
        i++;
    }
    if (sum > 0)
        printf("A");
    else if (sum < 0)
        printf("B");
    else
        printf("E");
    return 0;
}